package manager
{
	import flash.display.Sprite;
	import flash.events.Event;
	/**
	 *拖拽事件 
	 * @author 张进辉
	 * 
	 */	
	public class DragEvent extends Event
	{
		/**拖拽开始,由拖拽启动器派发*/
		public static const DRAG_START:String = "dragStart";
		/**进入拖拽目标容器,在鼠标进入目标组件时，由目标组件派发*/
		public static const DRAG_ENTER:String = "dragEnter";
		/**离开拖拽目标容器,在鼠标离开目标组件时，由目标组件派发*/
		public static const DRAG_EXIT:String = "dragExit";
		/**划过拖拽目标容器，在鼠标划过目标组件时，由目标组件派发*/
		public static const DRAG_OVER:String = "dragOver";
		/**放下拖拽对象，在放下拖拽物体时，如果目标组件存在则目标组件派发,否则由启动组件派发*/
		public static const DRAG_DROP:String = "dragDrop";
		/**拖拽完成，在拖拽物体被放置到目标组件时，由拖拽启动器派发，拖拽物体被放回原位置不会触发该事件*/
		public static const DRAG_COMPLETE:String = "dragComplete";
		
		
		/**拖拽启动对象*/
		public var dragInitiator:Sprite;
		/**拖拽数据*/
		public var dragSource:DragSource;
		/**
		 *实例化拖拽事件 
		 * @param type
		 * @param bubbles
		 * @param cancelable
		 * @param dragInitiator
		 * @param dragSource
		 * 
		 */		
		public function DragEvent(type:String, bubbles:Boolean=false, cancelable:Boolean=true,
								  dragInitiator:Sprite=null, dragSource:DragSource=null)
		{
			super(type, bubbles, cancelable);
			this.dragInitiator = dragInitiator;
			this.dragSource = dragSource;
		}
		
		override public function clone():Event
		{
			return new DragEvent(type,bubbles,cancelable,dragInitiator,dragSource);
		}
	}
}